﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Diagnostics.CodeAnalysis;

namespace Steve
{
    public enum UrlObjectType
    {
        SiteUrl,
        UrlRewrite
    }

    [Serializable]
    public sealed class UrlObjectNodeMetadata : IDirectoryNodeMetadata
    {
        public UrlObjectNodeMetadata(string path, UrlObjectType type, Guid id, bool ignoreQueryString)
        {
            Path = path;
            UrlObjectType = type;
            Id = id;
            IgnoreQueryString = ignoreQueryString;
        }

        public UrlObjectType UrlObjectType { get; set; }
        public Guid Id { get; set; }
        public bool IgnoreQueryString { get; set; }
        public string Path { get; set; }
    }

    [DataContract]
    [Serializable]
    public abstract class UrlObject : RevisedObject, IIntegrationObject
    {
        //header data
        [DataMember]
        public Guid Id { get; set; }
        [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
        [DataMember]
        public string Url { get; set; }
        [DataMember]
        public string SiteName { get; set; }
        [DataMember]
        public string SystemName { get; set; }
        [DataMember]
        public string ExternalId { get; set; }
        
        //revision data
        [DataMember]
        public DateTime? Start { get; set; }
        [DataMember]
        public DateTime? End { get; set; }
        [DataMember]
        public bool IsSecure { get; set; }
        [DataMember]
        public bool IgnoreQueryString { get; set; }	
    }

}
